The task of verifying the functionality of a software entity, such as a software component or a web service, which exposes an application programming interface (API), typically involves constructing a test model of the software entity, designing test cases, designing test data, developing test scripts, and executing the test cases using the test scripts in relation to the test model. Automating the generation of test cases and corresponding tests data, from a test model can, however, be difficult to achieve.
For instance, typically software entities are governed by a programming model that describes rules and guidelines for interacting with the entity. A test case for a software entity is a sequence of messages (i.e., an API operation) that can stimulate the system in a desirable or undesirable manner. Since a large system will have many interacting software entities, which can exchange combinations of messages among them, the programming model in question defines the boundary conditions that distinguish valid combinations from invalid combinations. In order to maximize the possibility of detecting defects, it can be desirable to generate random sequences of messages as test cases. However, a collection of the random sequences must nevertheless satisfy a probability distribution governed by the programming model. As such, generating random, or stochastic, test cases has however proven difficult to accomplish in practice.